package com.hanoiwiki.manager.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.hanoiwiki.dao.BlocksDAO;
import com.hanoiwiki.exception.DataAccessException;
import com.hanoiwiki.manager.BlocksManager;
import com.hanoiwiki.model.Blocks;

@Component
@Transactional
public class BlocksManagerImpl extends BaseManagerImpl implements BlocksManager{

	@Autowired
	private BlocksDAO blocksDao;
	
	@Override
	public void save(Blocks blocks) {
		try {
			blocksDao.save(blocks);
		} catch (DataAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}		
	}

	@Override
	public void update(Blocks blocks) {
		try {
			blocksDao.update(blocks);
		} catch (DataAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@Override
	public Blocks get(Integer id) {
		try {
			return blocksDao.get(id);
		} catch (DataAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

	@Override
	public List<Blocks> getList() {
		try {
			return blocksDao.getList();
		} catch (DataAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

	@Override
	public void remove(Integer id) {
		try {
			blocksDao.remove(id);
		} catch (DataAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
